package com.controller.company;

import com.dao.JobDao;
import com.dao.ResumeDao;
import com.dao.imp.JobDaoimpl;
import com.dao.imp.ResumeDaoImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.List;

@WebServlet("/CountReadResume")
public class CountReadResume extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        req.setCharacterEncoding("utf-8");
        resp.setContentType("text/html;charset=utf-8");
//        JobDao jobDao = new JobDaoimpl();
        ResumeDao resumeDao = new ResumeDaoImpl();

//        List<Object> list = null;
        int count;
        try {
//            list=jobDao.selectJobListById(req, resp);
//            list=jobDao.collectJobListById(req, resp);
            count=resumeDao.countReadResumeByJobId(req, resp);
            System.out.println("count = " + count);

            String s=String.valueOf(count);

            //输出次数
            PrintWriter out = resp.getWriter();
            out.write(s);
            out.flush();
            out.close();

        } catch (SQLException e) {
            e.printStackTrace();
        }

    }
}
